You tried to open an action query using the OpenQueryDef method, which is an obsolete method originally valid only with select queries. The preferred method for executing an action query is to use the Execute method of the QueryDef object.